#include "bridgelib.h"
#include "LuaBridge.h"

#include "bridge_test.h"

int luaopen_btest(lua_State* L)
{
	luabridge::getGlobalNamespace(L)
		.beginClass<BridgeTest>("test_bridage")
		.addConstructor<void (*)(void)>()
		.addData("test_str", &BridgeTest::m_string)
		.addStaticData("static_data", &BridgeTest::m_static_data)
		.addFunction("test", &BridgeTest::Test)
		.addProperty("name", &BridgeTest::GetName, &BridgeTest::SetName)
		.addCFunction("cFunc", &BridgeTest::cFunc)
		.addStaticFunction("sshow", BridgeTest::StaticShow)
		.addFunction("virtual", &BridgeTest::VirtualTest)
		.endClass()
		.deriveClass<BridgeTestChild, BridgeTest>("btest_child")
		.addConstructor<void (*)(std::string)>()
		.addData("test_child_string", &BridgeTestChild::m_child)
		.endClass()
		.addFunction("GetInstance", GetInstance)
		;

	lua_newtable(L);
	return 1;
}
